home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The X-Philes (2nd Revision)
/
The X-Philes Number 1 (1995).iso
/
xphiles
/
hp48_1
/
navigati
< prev
next >
Wrap
Text File
|
1995-03-31
|
5KB
|
158 lines
Article 5673 of comp.sys.handhelds:
Path: en.ecn.purdue.edu!noose.ecn.purdue.edu!news.cs.indiana.edu!news.nd.edu!spool.mu.edu!cs.umn.edu!uc!noc.MR.NET!gacvx2.gac.edu!hhdist
From: nadg-4@student.cs.chalmers.se (Lab. - konto Nadg-4)
Newsgroups: comp.sys.handhelds
Subject: <None>
Message-ID: <9104071821.AA16887@piggy.cs.chalmers.se>
Date: 7 Apr 91 18:21:31 GMT
Article-I.D.: piggy.9104071821.AA16887
Lines: 143
Return-path: <nadg-4@student.cs.chalmers.se>
To: handhelds@gac.edu
This is a navigation program that I have wrote. The equation's
is taken from Mr James Gentles's HAM routine's and so fare I
have found them correct. The NAV program takes the boat- (car-)
speed, your current position and future position. Observe that
South and West are negative. You can put the declination in DECL.
I have chosen the units so that they suit me but they are fairly
easy to change.
Happy navigation
Jonas Linden
PS Is there a waterproof case for the HP48SX?
O /
\/
/\~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
O \
%%HP: T(3)A(R)F(.);
DIR
NAV
\<< RCLF -3 SF
DEG \-> f
\<<
IFERR
NINPUT CALC H.M _
'Time' \->TAG ROT
DECL NEG + \^o _
'Course' \->TAG ROT
nmi _ 'Dist' \->TAG
ROT NGRAPH 0 WAIT
DROP 20 DOERR
THEN f STOF
'PPAR' PURGE ERASE
END
\>>
\>>
DECL -1
NINPUT
\<< CLLCD
"Your speed in knot"
{ ":Speed:" { 1 0 }
V } INPUT OBJ\-> 1 2
FOR j j \->STR
" position DD.MMSS
S and W are negative"
+ {
":Latitude :
:Longitude:"
{ 1 0 } V } INPUT
OBJ\->
NEXT
\>>
CALC
\<< HMS\-> 4 ROLL
HMS\-> 4 ROLL HMS\-> 4
ROLL HMS\-> SWAP 4
ROLL -
CASE DUP 180
>
THEN 360 -
END DUP
-180 <
THEN 360 +
END DUP 0
==
THEN
.000001 +
END
END \-> lah laa
dif
\<< 'ACOS(SIN(
lah)*SIN(laa)+COS(
lah)*COS(laa)*COS(
dif))' DUP 180 / \pi
* 6378.388 * 1.852
/ 2 RND SWAP \-> dis
'ACOS((SIN(laa)-SIN
(lah)*COS(dis))/(
COS(lah)*SIN(dis)))
'
IF dif 0 >
THEN NEG
360 +
END 2 RND
ROT ROT DUP ROT /
UVAL \->HMS 2 RND
\>>
\>>
NGRAPH
\<< 3 PICK ROT
ROT SWAP 1 3
START 1 \->GROB
ROT
NEXT COMPASS
{ # 0d # 15d } ROT
GOR SWAP { # 0d
# 30d } SWAP GOR
SWAP { # 0d # 45d }
SWAP GOR PICT STO {
# 0d # 0d } PVIEW
UVAL NEG 90 + DUP
COS 1.6 * 3.5 +
SWAP SIN 1.6 * R\->C
(3.5,0) LINE 0
FREEZE
\>>
COMPASS @ Remove all line feed's in GROB!!!
GROB 131 64 0000094A272DC14A3BBCCE0ECE0000000000000BAAA05550CA88822202
240000000000000FEAA67CC1CBB8344E0E440000000000000DA4A454504B8808820284
00000000000009A42754D14A3B366E0E64000000000000000000000000000000000000
000000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF70000000000000000001000000000000
00000000000000000000010000000C000000000000000000000000010000008F000000
0000000000000000000100000082000000000000000000000000010000008200000000
0000000000000000010000008200000000000000000000000001000000830000000000
0000000000000001000000000000000000000000000000000100000001000000000000
000000000000010000000100000000000000000000000001000000EF00000000000000
00000000000100000C1170000000000000000000000001000003018100000000000000
0000000001000080000200000000000000000000000100004000040000000000000000
0000000100002000080000000000000000000000010000100000100000000000000000
0000010008000000200000000000000000000001000800000020000000000000000000
0001000400000040000000000000000000000100040000004000000000000000000000
01000400000040000000000000000000000100C2008300800C00000000000000000009
BBF200440088BF000000000000000000012A2200280088A2000000000000000000093A
AF002800EBB2000000000000000000090A2200280080A2000000000000000000093A32
00440080A3000000000000000000010002008300800000000000000000000001000400
0000400000000000000000000001000400000040000000000000000000000100040000
0040000000000000000000000100080000002000000000000000000000010008000000
2000000000000000000000010000100000100000000000000000000001000020000800
0000000000000000000001000040000400000000000000000000000100008000020000
00000000000000000001000003018100000000000000000000000100000C1170000000
000000000000000001000000EF00000000000000000000000001000000010000000000
0000000000000001000000010000000000000000000000000100000000C00000000000
00000000000001000000ABF0000000000000000000000001000000AA20000000000000
000000000001000000AB20000000000000000000000001000000AA2000000000000000
0000000001000000AB300000000000000000000000010000000000000000FFFFFFFFFF
FFFFFFFFFFFFFFFFFFFFFF7000000000000000000000000000000000000008AAAB9384
790ECE02D9D566700000000008AAA8A0855B022406544411100000000008A8AB93875F
0E440ED5C1227000000000009098A0865D02840A544044100000000000909BA384790E
6402D9D13370000000
END